namespace PauloMorgado.SharePoint.Services.Views
{
    using System;
    using System.Net;
    using System.ServiceModel;

    internal static class ViewsService
    {
        public static IViewsService CreateViewsChannel(EndpointAddress endpointAddress, HttpClientCredentialType credentialType, NetworkCredential credential)
        {
            return ServiceHelper.CreateChannelFactory<IViewsService>(endpointAddress, credentialType, credential).CreateChannel();
        }

        public static IViewsService CreateViewsChannel(Uri baseUri, HttpClientCredentialType credentialType, NetworkCredential credential)
        {
            return CreateViewsChannelFactory(baseUri, credentialType, credential).CreateChannel();
        }

        public static ChannelFactory<IViewsService> CreateViewsChannelFactory(Uri baseUri, HttpClientCredentialType credentialType, NetworkCredential credential)
        {
            return ServiceHelper.CreateChannelFactory<IViewsService>(baseUri, "_vti_bin/Views.asmx", credentialType, credential);
        }
    }
}
